// !@#$McCaBe-InStRuMeNtAtIoN$#@!
// Instrumented with the McCabe Java Parser
// Version: 8.1.0.1 - 20110309
// Using Path Vector Instrumentation
// Date: Sun Apr 01 2012 20:39:08
package Driver;

import EventManager.Request;
import EventManager.RequestStatus;
import EventManager.ViewBookingsForEventAdminRequest;
import Model.Booking;
import Model.Event;
import Service.OutputManager;

import com.mccabe.*;


class ViewBookingsForEventAdminRequestView_7850d092fea13909cd54be3d3cb8097b {
    static java.lang.Object info[];
    static {
        info = new java.lang.Object[2];
        info[0] = new Integer(-1);
        info[1] = new String("R:\\yu\\Concordia\\SOEN 344 Design II\\Term Assignment\\Code Repo\\trunk\\Iteration 3\\ERS\\src\\Driver\\ViewBookingsForEventAdminRequestView.java");
    }
}


public class ViewBookingsForEventAdminRequestView extends RequestView 
{
	@Override
	public void view (Request r)
	{
int _mcFreq_e3dce6160dce658ccf91f04d8037ef60[] = new int[7];
PathVec_ERS_Iter3.enterMethod(ViewBookingsForEventAdminRequestView_7850d092fea13909cd54be3d3cb8097b.info,0,_mcFreq_e3dce6160dce658ccf91f04d8037ef60,0);

		ViewBookingsForEventAdminRequest req = (ViewBookingsForEventAdminRequest) r; // downcast
		
		OutputManager.println("\n*** Viewing request result of '".toUpperCase() + req.toString().toUpperCase() + "' ***");
		if (
PathVec_ERS_Iter3.decision(ViewBookingsForEventAdminRequestView_7850d092fea13909cd54be3d3cb8097b.info,0,_mcFreq_e3dce6160dce658ccf91f04d8037ef60,1,2,
PathVec_ERS_Iter3.testCondition(RequestStatus.Sustained == r.getStatus()
))
)
		{
			OutputManager.println("The request has been sustained.\n");
		}
		else if (
PathVec_ERS_Iter3.decision(ViewBookingsForEventAdminRequestView_7850d092fea13909cd54be3d3cb8097b.info,0,_mcFreq_e3dce6160dce658ccf91f04d8037ef60,3,4,
PathVec_ERS_Iter3.testCondition(RequestStatus.Pending == r.getStatus()
))
)
		{
			OutputManager.println("The request is pending.");
			endMessage();
			return;
		}
		else
		{
			OutputManager.println("The request has been refused.");
			endMessage();
			return;
		}
		
		OutputManager.println("Bookings returned: " + req.getBookings().size() + "\n");
		
{
for (Booking b : req.getBookings())
		{
PathVec_ERS_Iter3.decision(ViewBookingsForEventAdminRequestView_7850d092fea13909cd54be3d3cb8097b.info,0,_mcFreq_e3dce6160dce658ccf91f04d8037ef60,5,0,true);

			OutputManager.println(b.toString());
		}
PathVec_ERS_Iter3.decision(ViewBookingsForEventAdminRequestView_7850d092fea13909cd54be3d3cb8097b.info,0,_mcFreq_e3dce6160dce658ccf91f04d8037ef60,6,0,true);

}

		endMessage();
	}
	
	protected void endMessage()
	{
int _mcFreq_0d5cf166e151cf6b9e54394d2390ad11[] = new int[1];
PathVec_ERS_Iter3.enterMethod(ViewBookingsForEventAdminRequestView_7850d092fea13909cd54be3d3cb8097b.info,1,_mcFreq_0d5cf166e151cf6b9e54394d2390ad11,0);

		OutputManager.println("\n*** END OF VIEW ***");
	}
}
